﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EIIS.FrameWork.Service;
using EIIS.Infrastructure.Model.System.Authority;

namespace EIIS.Infrastructure.Service.System.Authority
{
    public interface IRoleManager : IGenericManager<Role>
    {
        /// <summary>
        /// 角色名称是否存在
        /// </summary>
        /// <param name="strName">角色值</param>
        /// <param name="strId">Id的值，新增-1，修改实际值</param>
        /// <param name="strWhere">其他查询条件</param>
        /// <returns></returns>
        bool IsExistWithName(string strName, string strId, string strWhere);

        /// <summary>
        /// 获取所有角色
        /// </summary>
        /// <param name="total">总数</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页条数</param>
        /// <param name="order">排序字段</param>
        /// <param name="sort">排序规则：asc,desc</param>
        /// <returns></returns>
        IList<Role> LoadAllWithPage(out long total, int page, int rows, string order, string sort);

        /// <summary>
        /// 根据角色ID、左联功能权限、左联菜单获取角色列表
        /// </summary>
        /// <param name="strId">角色ID</param>
        /// <returns></returns>
        IList<Role> GetByIdWithMenuAndPermissions(string strId);

        /// <summary>
        /// 从其他角色继承
        /// </summary>
        /// <param name="role">新的角色</param>
        /// <param name="inheritedRoleId">被继续角色的ID</param>
        void SaveRole(Role role, string inheritedRoleId);
    }
}
